<%@Page Language="C#" %>
<%@Import Namespace="Muki.Framework.FileUp" %>
<%@Import Namespace="Muki.Util" %>
<%@Import Namespace="Muki.Framework" %>
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<script type=text/javascript src="../system/script/System.js"></script>
</HEAD>
<BODY class=WindowClass leftMargin=5 topMargin=5 marginwidth=0 marginheight=0>
<script Language="C#" runat="server">
const string ZFILE_NAME = "UIDX460A";

string cName="";
string cXFAT_CODE="";
string cHeight   ="200";
bool   IsUpdate=false;
void Page_Load(Object sender, EventArgs e)
{
	string cAPP_PATH=Request.ServerVariables["APPL_PHYSICAL_PATH"];
	FileUpSession oFileUpSession = new FileUpSession();	
	if (oFileUpSession.IsFileUpRequest)
	{
		XFATManagement oXFATManagement= new XFATManagement();
		oXFATManagement.FileUpSession=oFileUpSession;
		oXFATManagement.APP_PATH=cAPP_PATH;
		oXFATManagement.Process();
		
		cXFAT_CODE=oXFATManagement.XFAT_CODE;

    ZZDebug.Write(ZFILE_NAME, cXFAT_CODE);
		
		Response.Write("");
		IsUpdate=true;
	}else
	{
		Response.Write("NULL");
	}

	cName  = ZZGeneral.XRequest("attachment_name"); 
	cHeight= ZZGeneral.XRequest("height"); 
}
</script>
<form method="post" enctype="multipart/form-data" name="<%=cName%>_form" id="<%=cName%>_form" action="../ztmenu/uidx470a.aspx?uid=<%=cXFAT_CODE%>&attachment_name=<%=cName%>">
<input type="hidden" name="<%=cName%>_filename" value="">
<input type="file" name="<%=cName%>_file"/>
<input type=submit name="ok" value="submit">
<script type=text/javascript>
<% if (IsUpdate){%>
	if (parent)
	{
		if (parent.document)
		{
			if (parent.document.getElementById("<%=cName%>"))
			{
				parent.document.getElementById("<%=cName%>").value="<%=cXFAT_CODE%>";
				var xfat_code="<%=cXFAT_CODE%>";
				if (parent!=null)
				{
					var oAjaxIndicator=parent.document.getElementById("AjaxIndicator");
				
				  if (oAjaxIndicator!=null) 
				  {
						oAjaxIndicator.style.top=parent.document.body.scrollTop;
						oAjaxIndicator.style.left=parent.document.body.scrollLeft+window.document.body.clientWidth-110;
						oAjaxIndicator.style.display="none";
					}
				}
				parent.document.getElementById("javascript_<%=cName%>").src="../ztmenu/uidx440a.aspx?xfat_code="+xfat_code+"&width=200&height=200&attachment_name=<%=cName%>";
			}
		}
	}
<% }%>
</script>
</form\>
</BODY>
</HTML>